package com.ezops.dao;

import java.util.List;

import org.hibernate.Transaction;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.stereotype.Repository;

import com.ezops.dao.generics.dao.hibernate.GenericDAOImpl;
import com.ezops.dao.generics.search.Search;
import com.ezops.models.ClientEzopsFieldMappingModel;

@Repository
public class ClientEzopsFieldMappingDAO extends
		GenericDAOImpl<ClientEzopsFieldMappingModel, Integer> {

	@Override
	public boolean[] save(ClientEzopsFieldMappingModel... entities) {
	
		boolean[] result = super.save(entities);
		return result;
	}

	public List<ClientEzopsFieldMappingModel> getAllMapping(int clientId,
			int asetClassId) {
		Search searchCriteria = new Search();
		searchCriteria.addFilterEqual("clientField.clientId", clientId);
		// searchCriteria.addFilterEqual("clientField.assetId", asetClassId);
		return search(searchCriteria);
	}
}
